From 9113a62c1b23ac5a242b0768ccf1561b0b738b65 Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Sat, 2 Sep 2006 12:11:54 +0100 Subject: [PATCH] [XEN] Fix mapping of p2m into monitor tables for external-mode guests. The previous code could map frame zero into the P2M table on PAE hosts. Signed-off-by: Tim Deegan --- xen/arch/x86/mm/shadow/multi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index e6210cc7fa..ace6a258f3 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -1792,8 +1792,10 @@ void sh_install_xen_entries_in_l2h(struct vcpu *v, for ( i = 0; i < MACHPHYS_MBYTES>>1; i++ ) { sl2e[shadow_l2_table_offset(RO_MPT_VIRT_START) + i] = - shadow_l2e_from_mfn(_mfn(l3e_get_pfn(p2m[i])), - __PAGE_HYPERVISOR); + (l3e_get_flags(p2m[i]) & _PAGE_PRESENT) + ? shadow_l2e_from_mfn(_mfn(l3e_get_pfn(p2m[i])), + __PAGE_HYPERVISOR) + : shadow_l2e_empty(); } sh_unmap_domain_page(p2m); } -- 2.30.2